/****** Object:  Table [dbo].[flightSchedule]    ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[flightSchedule](
	[flightScheduleId] [int] IDENTITY(1,1) NOT NULL,
	[flightName] [nchar](10) NULL,
	[departureCity] [nchar](10) NULL,
	[arrivalCity] [nchar](10) NULL,
	[departureDateTime] [datetime] NULL,
	[arrivalDateTime] [datetime] NULL,
	[departureTerminal] [nchar](10) NULL,
	[arrivalTerminal] [nchar](10) NULL,
	[distance] [nchar](10) NULL,
	[taxSurcharge] [float] NULL,
	[flightStatus] [nchar](10) NULL,
 CONSTRAINT [PK_flightSchedule] PRIMARY KEY CLUSTERED 
(
	[flightScheduleId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[flightSchedule]  WITH CHECK ADD  CONSTRAINT [FK_flightSchedule_arrivalcity] FOREIGN KEY([arrivalCity])
REFERENCES [dbo].[city] ([cityCode])
GO

ALTER TABLE [dbo].[flightSchedule] CHECK CONSTRAINT [FK_flightSchedule_arrivalcity]
GO

ALTER TABLE [dbo].[flightSchedule]  WITH CHECK ADD  CONSTRAINT [FK_flightSchedule_arrivalTerminal] FOREIGN KEY([arrivalTerminal])
REFERENCES [dbo].[terminal] ([terminalCode])
GO

ALTER TABLE [dbo].[flightSchedule] CHECK CONSTRAINT [FK_flightSchedule_arrivalTerminal]
GO

ALTER TABLE [dbo].[flightSchedule]  WITH CHECK ADD  CONSTRAINT [FK_flightSchedule_departurecity] FOREIGN KEY([departureCity])
REFERENCES [dbo].[city] ([cityCode])
GO

ALTER TABLE [dbo].[flightSchedule] CHECK CONSTRAINT [FK_flightSchedule_departurecity]
GO

ALTER TABLE [dbo].[flightSchedule]  WITH CHECK ADD  CONSTRAINT [FK_flightSchedule_departureTerminal] FOREIGN KEY([departureTerminal])
REFERENCES [dbo].[terminal] ([terminalCode])
GO

ALTER TABLE [dbo].[flightSchedule] CHECK CONSTRAINT [FK_flightSchedule_departureTerminal]
GO

ALTER TABLE [dbo].[flightSchedule]  WITH CHECK ADD  CONSTRAINT [FK_flightSchedule_flight] FOREIGN KEY([flightName])
REFERENCES [dbo].[flight] ([flightName])
GO

ALTER TABLE [dbo].[flightSchedule] CHECK CONSTRAINT [FK_flightSchedule_flight]
GO

